//
//  RouNavigationBar.swift
//  ShangYouNews
//
//  Created by wangkun on 2017/6/3.
//  Copyright © 2017年 baymax. All rights reserved.
//


import UIKit

extension UINavigationBar {
    
    public func showLine(show: Bool, color: UIColor = ColorFromRGB(240, 240, 240)) {
        
        self.shadowImage = UIImage()
        self.setBackgroundImage(UIImage(), for: .default)
        if show {
            self.setLayerShadow(UIColor(red: 0, green: 0, blue: 0, alpha: 0.2), offset: CGSize(width: 0, height: 0), radius: 0.5)
        } else {
            self.setLayerShadow(UIColor.clear, offset: CGSize.zero, radius: 0)
        }
        
    }
    
}


extension UITabBar {
    
    public func showLine(show: Bool, color: UIColor = ColorFromRGB(240, 240, 240)) {
        
        self.backgroundImage = UIImage()
        self.shadowImage = UIImage()
        if show {
            self.setLayerShadow(UIColor(red: 0, green: 0, blue: 0, alpha: 0.2), offset: CGSize(width: 0, height: 0), radius: 0.5)
        } else {
            self.setLayerShadow(UIColor.clear, offset: CGSize.zero, radius: 0)
        }
        
    }
    
}
